#pragma once

class CTinyIni
{
public:
	CTinyIni(){}
	virtual ~CTinyIni(){}

public:
	static string read_ini_value(const string& strIniFile, const string& strKey)
	{
		string strValue;
		char szBuf[4096] = {0};
		FILE* fp = fopen(strIniFile.c_str(), "rb");
		if(fp)
		{
			fread(szBuf, 1, sizeof(szBuf), fp);
			fclose(fp);
		}
		string strMyKey = strKey + "=";
		char* pStart = strstr(szBuf, strMyKey.c_str());
		if(pStart)
		{
			pStart += strMyKey.size();
			char* pEnd = strstr(pStart, "\r\n");
			if(pEnd)
			{
				*pEnd = 0;
				strValue = pStart;
			}
		}
		return strValue;
	}
protected:
private:
};



